﻿<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<title>代理商管理菜单</title>
	<link rel="stylesheet" href="/css/common.css">
	<link rel="stylesheet" href="/scriptZIP/layui.min.css">
	<link rel="stylesheet" href="/css/menu.css">
	<link rel="stylesheet" href="/css/motai2.css">
	<link rel="stylesheet" href="/scriptZIP/font-awesome.css">
	<style>
		.header_img {
			width: 128px;
			height: 128px;
		}

		.main-logo_l {
			width: 220px;
			/* height: 40px; */
			font-size: 20px;
			line-height: 40px;
			font-weight: bold;
			text-overflow: ellipsis;
			overflow: hidden;
			white-space: nowrap;
			color: black;
		}

		.main-right {
			position: relative;
			max-width: 230px;
			line-height: 30px;
			height: 100%;
			text-align: right;
			cursor: pointer;
		}

		.main-username {
			width: 100%;
			font-size: 16px;
			overflow: hidden;
			height: 100%;
			line-height: 45px;
			text-overflow: ellipsis;
			white-space: nowrap;
		}

		.main-right:hover .main-dropdown-menu {
			/* visibility: visible; */
			height: 120px;
		}

		.main-dropdown-menu {
			/* visibility: hidden; */
			height: 0;
			box-shadow: 0px 0px 4px 0px rgb(206, 204, 204);
			overflow: hidden;
			border-radius: 5px;
			/* padding: 0; */
			background-color: #ffffff;
			position: absolute;
			top: 40px;
			left: 50%;
			transform: translateX(-50%);
			text-align: center;
			font-size: 14px;
			transition: 0.25s ease-in-out all;
		}

		.main-dropdown-menu li {
			width: 110px;
			padding: 3px 1px;
		}

		.main-dropdown-menu li:hover {
			background-color: #b9e8ff;
		}

		.main-dropdown-download img {
			width: 20px;
			height: 20px;
		}

		.main-dropdown-menu-a {
			display: block;
			width: 100%;
		}

		i.layui-icon {
			font-size: 30px;
			color: black;
		}

		.select {
			color: white !important;
		}

		.collapse-enter {
			max-height: 0;
		}

		.collapse-enter-active {
			max-height: 100%;
			transition: max-height .5s ease;
		}

		.collapse-leave {
			max-height: 100%;
		}

		.collapse-leave-active {
			max-height: 0;
			transition: max-height .5s ease;
		}

		.slogan {
			color: red;
			margin: 0 calc((100vw - 655px) / 2);
			font-size: 16px;
			font-weight: bold;
		}

		.home {
			margin-left: calc(220px + 2.5rem);
		}

		.load,
		.home {
			width: 20px;
			height: 20px;
			margin-top: 5px;
			cursor: pointer;
		}

		.mask {
			position: fixed;
			left: 222px;
			top: 35px;
			bottom: 30px;
			width: calc(100% - 240px);
			height: calc(100% - 65px);
			z-index: 10;
			background-color: rgba(62, 62, 62, 0.5);
			color: #000;
		}

		.tutorials {
			height: 360px;
			width: 300px;
			margin: auto;
			margin-top: calc((100% - 65px - 360px) / 7);
			background-color: white;
			border-radius: 5px;
		}

		.tutorials-title {
			height: 35px;
			line-height: 35px;
			text-align: center;
			font-size: 18px;
			font-weight: bold;
			letter-spacing: 0.3em;
			border-bottom: 1px solid silver;
		}

		.tutorial {
			height: 40px;
			line-height: 40px;
			width: 100%;
			text-align: center;
			font-size: 16px;
		}

		.tutorial a {
			color: #1E9FFF;
			text-decoration: underline !important;
		}

		[v-if] {
			display: none;
		}

		.download {
			cursor: pointer;
			display: inline-block;
			vertical-align: bottom;
			font-weight: bold;
			color: deepskyblue;
			text-decoration: underline;
		}

		iframe {
			width: calc(100% - 10px);
			height: 100%;
			overflow-y: scroll;
			margin-top: -1em;
			border-left: 1px solid white;
			overflow: hidden;
		}

		.modal-data13 {
			width: 400px;
			height: 300px;
		}

		.modal-content {
			width: 380px;
			height: 180px;
			margin: 10px;
		}

		.modal_title>span {
			font-size: 14px;
			color: #ACACAC;
		}

		.modal {
			width: 380px;
			margin-top: 30px;
		}

		.modal-title {
			display: inline-block;
			font-size: 16px;
			text-align-last: justify;
			text-align: justify;
		}

		.modal_password,
		.modal_username {
			width: 250px;
			margin: 0 30px;
		}

		.sure {
			float: right;
			margin-right: 50px;
			width: 60px;
			height: 25px;
		}

		.show {
			visibility: visible !important;
		}

		.back {
			float: left;
			margin-left: 50px;
			width: 60px;
			height: 25px;
		}
		.block{
			display: block;
			line-height: 36px;
		}
	</style>
</head>

<body class="main-body">
	<div id="vue-root">

		<div class="main-header" style="height: 30px;">
			<div class="main-logo_l" align="center">热学管理平台</div>
			<div class="main-right">
				<p class="main-username">{{('用户')}}：{{username}}</p>
				<ul class="main-dropdown-menu">
					<li>
						<div @click="popup=true" class="main-nav-item block">下载教程</div>
					</li>
					<li v-text="'修改信息'" @click="show=true"></li>
					<li class="main-dropdown-download">
						<a class="main-nav-item block" href="/pc/logout">点击退出云平台</a>
					</li>
				</ul>
			</div>

		</div>
		<div class="main-side" style="width: 220px;margin-top: -20px;" v-if="isShowMenuAndHome">
			<div class="main-side-scroll" style="width: 220px; border-right: 1px solid white;">
				<form id="form" method="post" ref="form" enctype="multipart/form-data" style="display: none">
					<input type="file" id="file" ref="file" name="file" accept="image/*" @change="upload">
				</form>
				<div class="user_info" style="height: 100px;">
					<label for="file">
						<img :src="getImg(avatar)" alt="" class="header_img" title="点击更换头像"
							style="width: 70px;height: 70px;">
					</label>
				</div>
				<br>
				<ul id="accordion" class="accordion">
					<li v-for="(menu,index) in menues" :key="index" :class="{open:!fold&&mainstyle0==index}"
						v-if="!menu.hidden&&any(menu)">
						<div class="link" @click="onclick(index)">
							<i class="fa" :class="{[menu.headerImg]:true}"></i>{{menu.title}}
							<i class="fa fa-chevron-down arrow"></i>
						</div>

						<transition name="collapse" mode="out-in">
							<ul class="submenu" v-show="!fold&&mainstyle0==index">
								<li v-for="(sub,index1) in menu.menues" v-if="!sub.hidden">
									<a target="myiframe" :href="sub.ref" @click="onclick1(index,index1)"
										v-text="sub.title" :class="{selected:mainstyle==index&&mainstyle1==index1}"></a>
								</li>
							</ul>
						</transition>

					</li>
				</ul>
			</div>

			<div id="modal-overlay3" :class="{show:show}">
				<div class="modal-data13">
					<div class="modal_title">用户信息 <span @click="show=false">取消</span></div>
					<div class="modal-content">
						<div class="modal">
							<div class="modal-title">账号</div>
							<input class="modal_username" v-model="agent.username">
						</div>
						<div class="modal">
							<div class="modal-title">密码</div>
							<input class="modal_password" v-model="agent.password">
						</div>
					</div>
					<hr style="margin-top: 10px">
					<button class="sure" @click="show=false">关闭</button>
					<button class="back" @click="submit">保存</button>
				</div>
			</div>
		</div>
		<div class="main-content main-content-right" style="left: 220px; top: 10px;" v-if="isShowMenuAndHome">
			<iframe :src="filtrateHome()" name="myiframe"></iframe>
		</div>
		<div class="record-number">
			<a>广州护校通电子科技有限公司版权所有&copy;2006-2019</a>
			<a href="http://www.miit.gov.cn" target="_blank">粤ICP备17102741号</a>
			<a href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=44011302002266" target="_blank">
				<img class="icon" src="../image/police-icon.png">&nbsp;&nbsp;粤公网安备&nbsp;&nbsp;44011302002266号
			</a>
		</div>
		<!-- 下载教程 -->
		<!-- 遮罩层 -->
		<div class="mask" v-if="popup" @click="popup=false">
			<div class="tutorials" @click.stop>
				<div class="tutorials-title">点击下载教程</div>
				<div class="tutorial"><a href="/tutorial/校园平台操作教程.pdf">校园平台操作教程</a></div>
				<div class="tutorial"><a href="/tutorial/人脸识别考勤机使用教程.pdf">人脸识别考勤机使用教程</a></div>
				<div class="tutorial"><a href="/tutorial/考勤机与U盘文件管理.mp4">考勤机与U盘文件管理</a></div>
				<div class="tutorial"><a href="/tutorial/考勤机硬件安装教程（10.1壁挂）.mp4">考勤机硬件安装教程（10.1壁挂）</a></div>
				<div class="tutorial"><a href="/tutorial/考勤机设备号及主板型号.mp4">考勤机设备号及主板型号</a></div>
				<div class="tutorial"><a href="/tutorial/考勤机连接WiFi.mp4">考勤机连接WiFi</a></div>
				<div class="tutorial"><a href="/tutorial/考勤机App更新.mp4">考勤机App更新</a></div>
				<div class="tutorial"><a href="/tutorial/分班播报机添加教程.pdf">分班播报机添加教程</a></div>
			</div>
		</div>

		<div id="modal-overlay3" :class="{show:show}">
			<div class="modal-data13">
				<div class="modal_title">用户信息 <span @click="show=false">取消</span></div>
				<div class="modal-content">
					<div class="modal">
						<div class="modal-title">账号</div>
						<input class="modal_username" v-model="agent.username">
					</div>
					<div class="modal">
						<div class="modal-title">密码</div>
						<input class="modal_password" v-model="agent.password">
					</div>
				</div>
				<hr style="margin-top: 10px">
				<button class="sure" @click="show=false">关闭</button>
				<button class="back" @click="submit">保存</button>
			</div>

		</div>

	</div>
	<script src="/scriptZIP/qs.min.js"></script>
	<script src="/scriptZIP/vue.min.js"></script>

	<script src="/scriptZIP/axios.min.js"></script>
	<script src="/js/common.js"></script>
	<script src="/js/bg.js"></script>
	<script src="/js/auth_util.js"></script>

	<script>

		var app = new Vue({
			el: '#vue-root',
			data: {
				isShowMenuAndHome:false,//解决当菜单不显示时页面闪现菜单问题
				show: false,
				fold: true,
				mainstyle: 0,
				mainstyle1: null,
				mainstyle0: 0,
				menues: [
					{
						title: '校区管理',
						ref: 'agent_school.html',
						headerImg: 'fa-university',
						menues: [
							{
								title: '首页',
								ref: '../overview.html',
								key: 'summary',
							}, {
								title: '校区帐号',
								ref: 'agent_school.html',
								key: 'account',
							}/*, {
								title: '食谱管理',
								ref: 'basis_cookbook2.html',
								key: 'cookbook',
							}*/
						]
					},{
						title: '教务管理',
						ref: '',
						headerImg: 'fa-graduation-cap',
						menues: [
							{
								title: '学员管理',
								ref: 'educational_student.html',
								key: 'studentManagement',
							},
							{
								title: '续费管理',
								ref: 'renewalManagement.html',
								key: 'renewals',
							},
							{
								title: '学情管理',
								ref: 'xue_qing_management.html',
								key: 'xueQingManagement',
							},
							{
								title: '课程预警',
								ref: 'warning_reminder.html',
								key: 'renewalWarning',

							}, 
							{
								title: '成绩管理',
								ref: 'agent_scores1.html',
								// key: 'classManage',
								// key1: 'classManage'
							}, 
							{
								title: '学情管理',
								ref: 'agent_scores.html',
								// key: 'classManage',
								// key1: 'classManage'
							}, 
							{
								title: '科目管理',
								ref: 'agent_subject.html',
								// key: 'classManage',
								// key1: 'classManage'
							}, 
							// {
							// 	title: '查看校区的班级',
							// 	ref: '../null.html',
							// 	key: 'checkClass',
							// 	// key1: 'classManage'
							// }
						]
					},
					{
						title:'课程设置',
						ref:'../null.html',
						headerImg:'fa-gear',
						menues:[
							{
								title:'课销管理',
								ref:'agent_attendance_records.html',
								key:'sellManage'
							},
							// {
							// 	title:'考勤管理',
							// 	ref:'../null.html',
							// 	key:'checkingIn'
							// },
							{
								title:'课程类目',
								ref:'educational_course_category.html',
								key:'courseType'
							},{
								title:'课程明细',
								ref:'educational_course.html',
								key:'course'
							}
						]
					},
					{
						title:'餐食管理',
						ref:'../null.html',
						headerImg:'fa-list-alt',
						menues:[
							{
								title:'报餐管理',
								ref:'meal_agent.html',
								key:'mealmanagement'
							},{
								title:'餐费管理',
								ref:'table_money.html',
								key:'expensemanagement'
							},{
								title:'食谱管理',
							
								ref:'basis_cookbook2.html',
								key:'cookbook'
							},
						]
					},
					{
						title: '招生管理',
						ref: '',
						headerImg: 'fa-user-plus',
						menues: [
							{
								title: '招生分析',
								ref: 'enrollment_analysis.html',
								key: 'enrollmentAnalysis',
							},
							{
								title: '数据类型',
								ref: 'catalogue.html',
								key: 'dataType',
							},
							{
								title: '跟进提醒',
								ref: 'important_follow_up.html',
								key: 'schedule',
							},
							// {
							// 	title: '数据分配',
							// 	ref: '../null.html',
							// 	key: 'dataAllot',
							// }, 
							{
								title: '招生信息',
								ref: 'educational_student_zhaos.html',
								key: 'admissionInformation',
							},
							{
								title: '公共资源',
								ref: 'public_resources.html',
								key: 'publicresource',
							},
							{
								title: '回收资源',
								ref: 'recovery_resources.html',
								key: 'recycle',
							},
						]
					},
					{
						// title: '数据管理',
						title: '管理分析',
						ref: '',
						headerImg: 'fa-signal',
						menues: [
							{
								title: '数据分析',
								ref: 'data_analysis.html',
								key: 'recruitStudent',
							},							
							{
								title: '学员分析',
								ref: 'student_fx.html',
								key: 'studentData',
							}, {
								title: '课程分析',
								ref: 'educational_student_course.html',
								key: 'courseData',
							},
							{
								title: '续费分析',
								ref: 'renewal_analysis.html',
								key: 'renewData',
							},
							 {
								title: '校区分析',
								ref: '../statistics.html',
								key: 'schoolData',
							},{
								title: '报餐分析',
								ref: 'newmeal_analysis.html',
								key: 'mealanalysis',
							}
						]
					},
					{
						// title: '审核管理',
						title: '审核管理',
						ref: '',
						headerImg: 'fa-bell',
						menues: [
							{
								title: '请假审核',
								ref: 'interactive_leave.html',
								key: 'qingJiaShenPi',
							}, {
								title: '停课审核',
								ref: 'suspend_course.html',
								key: 'tingKeShenPi',
							}, {
								title: '订单审核',
								ref: 'agent_orderXx.html',
								key: 'shouDongDuiZhang',
							}, {
								title: '退款审核',
								ref: 'refund_orderXx.html',
								key: 'tuiKuanShenPi',
							}
						]
					},
					 {
						// title: '人员资源',
						title: '人力资源',
						ref: 'agent_account.html',
						headerImg: 'fa-users',
						menues: [
							{
								title: '权限组',
								ref: 'agent_account.html',
								key: 'authorityManagement',
							}, {
								title: '校区分组',
								ref: 'school_grouping.html',
								key: 'authorityManagement1',

							},
							{
								title: '员工管理',
								ref: 'staffManagement.html',
								key: 'memberManage',
							}, 
							 {
								title: '绩效规则',
								ref: '../null.html',
								key: 'xiaoQuTiCheng',
							 },
							{
								title: '绩效统计',
								ref: '../null.html',
								key: 'jiXiaoTongJi',
							}
						]
					}, /*{
						title: '学员管理',
						ref: '',
						headerImg: 'fa-user',
						menues: [
							 {
								title: '学员预警',
								ref: 'warning_reminder.html',
								key: 'studentWarning',
							},  {
								title: '家校共建激励方案',
								ref: 'jiLiFangAn.html',
								key: 'jiLiFangAn',
							}
						]
					},*/
					  
					{
						title: '财务管理',
						ref: '',
						headerImg: 'fa-clipboard',
						menues: [
							{
								title: '订单管理',
								ref: 'finance_order_agent.html',
								key: 'order',
							},
							//  {
							// 	title: '退款管理',
							// 	ref: '../null.html',
							// 	key: 'refundManagement',
							// }, {
							// 	title: '退款记录',
							// 	ref: '../null.html',
							// 	key: 'refundRecord',
							// }
						]
					},
					 {
						title: '公众号',
						ref: '../wechat_platform.html',
						headerImg: 'fa-comments',
						menues: [
							{
								title: '公众号',
								ref: '../wechat_platform.html',
								key: 'platform',
							}
						]
					}, 
				],
				main:false,//true是代理商，false是子代理商
				avatar: null,
				userId: null,
				username: null,
				popup: false,
				agent: {
					username: null
				}
			},
			created: function () {
				axios.get('/pc/user').then(function (res) {
					this.avatar = res.data.avatar;
					this.userId = res.data.id;
					this.username = res.data.username;
					this.agent.username = this.username;
					this.main=res.data.main
					localStorage.setItem('staffUserName', res.data.staffUserName);
					localStorage.setItem('staffUserId', res.data.staffUserId);
					localStorage.setItem('schoolGroupId', res.data.schoolGroupId);
					this.setMenus();
				}.bind(this));
			},
			methods: {
				any: function (menu) {
					return menu.menues.some(function (it) {
						return !it.hidden;
					})
				},
				hide: function (hides) {
					this.hide0(hides, 'key');
				},
				hide0: function (hides, key) {
					var _self=this
					var func = function (it) {
						if ((key in it) && hides[it[key]])
							Vue.set(it, 'hidden', true);
						if (_self.main==false &&it[key]=='authorityManagement')
							Vue.set(it, 'hidden', true);
					}
					this.menues.forEach(function (it) {
						func(it);
						it.menues.forEach(func);
					});
					var aa=this.filtrateHome()
				},
				//筛选默认显示页面
				filtrateHome:function(){
					var urlarr=[]
					for (let i = 0; i < this.menues.length; i++) {
						for (let j = 0; j < this.menues[i].menues.length; j++) {
							// console.log(this.menues[i].menues[j].hidden);
							if(!this.menues[i].menues[j].hidden){
								urlarr.push(this.menues[i].menues[j].ref)
							}
						}
					}
					this.isShowMenuAndHome=true
					if(urlarr.length){
						return urlarr[0];
					}else{
						return '/null.html'
					}
				},
				upload: function () {
					axios.post('/pc/upload/avatar',
						new FormData(this.$refs.form)).then(function (res) {
							var avatar = res.data.data;
							axios.post('/pc/user/avatar/' + this.userId + '?avatar=' + avatar).then(function (res) {
								this.avatar = avatar;
							}.bind(this));
						}.bind(this));
				},
				getImg: function (pic) {
					return pic ? '/static/0/avatar/' + pic : '/image/admin.svg';
				},
				setMenus: function () {

					getAble(function (a) {
						var o = {};
						for (var key in a)
							if (typeof a[key] == 'number')
								o[key] = !f(a[key])[0];
						this.hide0(o, 'key');
						this.loaded = true;
					}.bind(this));
				}
				, onclick1: function (index, index1) {
					this.mainstyle = index;
					this.mainstyle1 = index1;
				},
				onclick: function (index) {
					if (this.mainstyle0 == index) this.fold = !this.fold;
					else {
						this.fold = false;
						this.mainstyle0 = index;
					}
				},

				submit: function () {
					var o = {
						id: this.userId,
						username: this.agent.username,
						password: this.agent.password
					};
					if (o.username == this.username && !o.password) {
						this.show = false;
						return;
					}
					axios.put('/pc/user', o).then(function (res) {
						this.show = false;
						alert('修改成功');
					}.bind(this));
				},
			}
		});
		sessionStorage.removeItem('hxt-p');

		/*
		
		menues: [
					{
						title: '校区管理',
						ref: 'agent_school.html',
						headerImg: 'fa-university',
						menues: [
							{
								title: '概览详情',
								ref: '../overview.html',
								key: 'summary',
							}, {
								title: '校区帐号',
								ref: 'agent_school.html',
								key: 'account',
							}, {
								title: '食谱管理',
								ref: 'basis_cookbook2.html',
								key: 'cookbook',
								}
							]
					}, {
						title: '人员管理',
						ref: 'agent_account.html',
						headerImg: 'fa-users',
						menues: [
							{
								title: '权限组',
								ref: 'agent_account.html',
								key: 'authorityManagement',
							}, {
								title: '学校分组',
								ref: 'school_grouping.html',
								key: 'authorityManagement',

							},
							{
								title: '员工管理',
								ref: 'staffManagement.html',
								key: 'accountManagement',
							}
						]
					}, {
						title: '学员管理',
						ref: '',
						headerImg: 'fa-user',
						menues: [
							{
								title: '学员管理',
								ref: 'educational_student.html',
								key: 'studentManagement',
							}, {
								title: '学员预警',
								ref: 'warning_reminder.html',
								key: 'studentWarning',
							}, {
								title: '学情管理',
								ref: 'xue_qing_management.html',
								key: 'xueQingManagement',
							}, {
								title: '家校共建激励方案',
								ref: 'jiLiFangAn.html',
								key: 'jiLiFangAn',
							}
						]
					}, 
					 {
						title: '招生管理',
						ref: '',
						headerImg: 'fa-user-plus',
						menues: [
							{
								title: '数据分配',
								ref: '../null.html',
								key: 'dataAllot',
							}, {
								title: '招生信息',
								ref: '../null.html',
								key: 'admissionInformation',
							}
						]
					}, {
						title: '数据管理',
						ref: '',
						headerImg: 'fa-signal',
						menues: [
							{
								title: '数据类型管理',
								ref: 'catalogue.html',
								key: 'dataType',
							}, {
								title: '招生数据分析',
								ref: '../null.html',
								key: 'recruitStudent',
							},
							{
								title: '学员数据分析',
								ref: 'student_fx.html',
								key: 'studentData',
							}, {
								title: '课程数据分析',
								ref: 'educational_student_course.html',
								key: 'courseData',
							}, {
								title: '校区数据分析',
								ref: '../statistics.html',
								key: 'schoolData',
							}
						]
					},
					
					{
						title: '教务管理',
						ref: '',
						headerImg: 'fa-graduation-cap',
						menues: [
							{
								title: '课程类目管理',
								ref: 'educational_course_category.html',
								key: 'courseType',

							}, {
								title: '课程管理',
								ref: 'educational_course.html',
								key: 'course',
								key1: 'course'
							}
						]
					}, {
						title: '公众号',
						ref: '../wechat_platform.html',
						headerImg: 'fa-comments',
						menues: [
							{
								title: '公众号',
								ref: '../wechat_platform.html',
								key: 'platform',
							}
						]
					}, {
						title: '审核管理',
						ref: '',
						headerImg: 'fa-bell',
						menues: [
							{
								title: '请假审批',
								ref: '../null.html',
								key: 'qingJiaShenPi',
							}, {
								title: '停课审批',
								ref: '../null.html',
								key: 'tingKeShenPi',
							}, {
								title: '手动对账',
								ref: 'agent_orderXx.html',
								key: 'shouDongDuiZhang',
							}, {
								title: '退款审批',
								ref: '../null.html',
								key: 'tuiKuanShenPi',
							}
						]
					}, {
						title: '财务管理',
						ref: '',
						headerImg: 'fa-clipboard',
						menues: [
							{
								title: '订单管理',
								ref: 'finance_order_agent.html',
								key: 'order',
							}, {
								title: '退款管理',
								ref: '../null.html',
								key: 'refundManagement',
							}, {
								title: '退款记录',
								ref: '../null.html',
								key: 'refundRecord',
							}, {
								title: '绩效提成设置',
								ref: '../null.html',
								key: 'jiXiaoTiCheng',
							}, {
								title: '绩效统计',
								ref: '../null.html',
								key: 'jiXiaoTongJi',
							}, {
								title: '校区提成管理',
								ref: '../null.html',
								key: 'xiaoQuTiCheng',
							}
						]
					}

				],
		
		*/
	</script>
</body>

</html>